import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/components/Home.vue'
import My from '@/components/My.vue'
import Talk from '@/components/Talk.vue'
import Ai from '@/components/Ai.vue'
import AiPro from '@/components/AiPro.vue'
import LoginAndReg from '@/components/LoginAndReg.vue'
import AHome from '@/components/AHome.vue'
import ATalk from '@/components/ATalk.vue'
import AUser from '@/components/AUser.vue'
import AWorkbenches from '@/components/AWorkbenches.vue'
import MarketInfol from '@/components/MarketInfo.vue'
import GoodDetail from '@/components/GoodDetail.vue'
import ATalk2 from '@/components/ATalk2.vue'
import Strategy from '@/components/Strategy.vue'
import GlobalShopping from '@/components/GlobalShopping.vue'
import ProductDetail from '@/components/ProductDetail.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/login',
    component: LoginAndReg
  },
  {
    path: '/home',
    component: Home,
    children: [
      { path: '/', redirect: '/info' },
      { path: '/info', component: MarketInfol },
      { path: '/my', component: My },
      { path: '/talk', component: Talk },
      { path: '/ai', component: Ai },
      { path: '/aipro', component: AiPro },
      { path: '/goodDetail', component: GoodDetail },
      { path: '/strategy', component: Strategy },
      { path: '/globalShopping', component: GlobalShopping },
      { path: '/productDetail', component: ProductDetail }
    ]
  },
  {
    path: '/home2', component: AHome,
    children: [
      { path: '/workbenches', component: AWorkbenches },
      { path: '/customerList', component: AUser },
      { path: '/atalk', component: ATalk },
      { path: '/atalk2', component: ATalk2 }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
